package com.itheima.tlias84.Po;

import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class InsertStudentParam {
        @NotNull(message = "姓名不能为空")
        @Length(min = 2, max = 10, message = "姓名长度必须在2-10之间")
        private String name;

        @Length(min = 10, max = 10, message = "学号长度必须是10位")
        private String no;
        private Integer gender;

        @Length(min = 11, max = 11, message = "手机号长度必须是11位")
        @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式错误")
        private String phone;
        private String idCard;
        private Integer isCollege;
        private String address;
        private Integer degree;
        private LocalDate graduationDate;
        private Integer clazzId;
        private LocalDateTime createTime;
        private LocalDateTime updateTime;
    }

